const path = require('path');
const {VueLoaderPlugin} = require('vue-loader');

module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'jingsi.datav.js',
        // libraryTarget: 'umd',  //用到的模块定义规范
        // library: 'myLib',   //库的名字
        // libraryExport: 'default',
        library: {
            name:'JingsiDataV',
            type:'var',
            export: 'default'
        }
    },
    module: {
        rules: [
            {
                test: /\.vue$/,
                loader: 'vue-loader'
            },
            {
                test: /\.css$/i,
                use: ['style-loader', 'css-loader'],
            },
            {
                test: /\.(png|svg|jpg|jpeg|gif)$/i,
                type: 'asset/resource',
            },
            {
                test: /\.(woff|woff2|eot|ttf|otf)$/i,
                type: 'asset/resource',
            },
            {
                test: /\.js$/,
                loader: 'babel-loader'
            },
        ],
    },
    plugins: [
        // 请确保引入这个插件来施展魔法
        new VueLoaderPlugin()
    ]
};